<template>
	<div class="lhang_dynamic">
		<ion-content12>
			<div class="news-wrapper">
				<news title="网站公告" :news="news1"></news>
				<news title="行业资讯" :news="news2"></news>
				<news title="常见问题" :news="news3"></news>
			</div>
			</ion-content12>
	</div>
</template>

<script>
	import news from './news'
	export default {
		name: 'lhang_dynamic',
		data() {
			return {
				content: "宝宝是链行动态",
				news: [],
			}
		},
		components: {
			news,
		}, //这里注册
		methods: {},
		computed: {
			news1() {
				const t = this.news.filter(d => (d.iinfoType === '网站公告'));
				return t.splice(0, 4);
			},
			news2() {
				const t = this.news.filter(d => (d.iinfoType === '行业资讯'));
				return t.splice(0, 4);
			},
			news3() {
				const t = this.news.filter(d => (d.iinfoType === '常见问题'));
				return t.splice(0, 4);
			},
			total() {
				const data = this.spotlatestvolumepricedata ?
					JSON.parse(this.spotlatestvolumepricedata) : '';
				if(data) {
					return data.data;
				}
				return 0;
			},
		},
		mounted() {
			var that = this;
			//获取newslist
			this.lh_http('get', "info/infoList", {}).done(function(res) {
				if(res.status){
					that.news = res.data.list;
				}
			})
		},
	}
</script>

<!-- Add "scoped" attribute to limit CSS to this component only -->
<style lang="scss">
	.lhang_dynamic {
		margin:80px auto 40px;
		width:1200px;
		height:100%;
		.news-wrapper{
			overflow:hidden;
			zoom:1;
			.news {
				float: left;
				width: 33.33%;
			}
		}
		
	}
</style>